/***********************************************************************************************************************
**	filename: cfg_info.h
**	author: Echo Zhang @2021-05-23
**  e-mail: not_xx@126.com
***********************************************************************************************************************/

#ifndef CFG_INFO_INCLUDED
#define CFG_INFO_INCLUDED

#include <stdio.h>
#include "../user_types.h"

#ifdef __arm__
#define _CFG_FILE_NAME                      "/oemdata/config.json"
#else
#define _CFG_FILE_NAME                      "config.json"
#endif

struct apn_info {
    char apn[20];
    char user[32];
    char passwd[32];
};

struct server_info {
    char addr[20];
    ui16 port;
    char file_path[128];
};

struct cfg_info {
    struct apn_info *_apn;
    struct server_info *_tcp;
};

bool cfg_info_load(const char *filename, struct cfg_info *cfgInfo);
// bool cfg_info_save(const char *filename, const struct cfg_info *cfgInfo);
void print_config(const struct cfg_info *cfgInfo);

#endif	/* CFG_INFO_INCLUDED */

/***********************************************************************************************************************
**	endline
***********************************************************************************************************************/
